<template>
	<view class="container-vip">
		<view class="lang-top">
			<view class="backIcon" @click="back()">
				<uni-icons type="left" size="26"></uni-icons>
			</view>
			<view class="langText">
				{{$t('钱包管理')}}
			</view>
			<view class="clearView"></view>
		</view>
		<view class="content-view">
			<p><span class="colorRed">{{banklist.length}}</span> {{$t('个绑定的钱包')}}</p>
			<view  class="item-list" v-for="(item,index) in banklist" :keys="index">
				<view  class="de_wrap">
					<p  class="tit">
						<span>{{item.cradnum}}</span>
					<!-- <span>{{item.num}}</span> -->
					</p>
					<p  class="time">{{item.create_at}}</p>
				</view>
				<view class="price"><span>{{item.name}}</span></view>
			</view>
		</view>
		<view class="basic_btn" @click="addPurse">
			<p>{{$t('新增钱包')}}</p>
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				banklist:[]
			}
		},
		onShow() {
			this.getlist()
		},
		methods:{
			getlist(){
				this.$http.get(
					'api/MemberBank/index',//接口名
					{},//参数合集
					{},
					false
				).then(res=>{
					this.banklist = res.data.data
				},(err)=>{//失败的操作
					uni.showToast({
						icon: 'error',
						title: err.data.message
					});
				})
			},
			back(){
				uni.navigateTo({
					url:'/pages/my/accountSetting'
				})
			},
			addPurse(){
				uni.navigateTo({
					url:'/pages/index/addPurse'
				})
			}
		}
	}
</script>

<style scoped>
	.price{
	    flex: 1;
	    font-size: 20px;
	    line-height: 28px;
	    font-weight: 700;
	    text-align: right;
	    color: #f12211;
	    white-space: nowrap;
	}
	.price2{
	    flex: 1;
	    font-size: 20px;
	    line-height: 28px;
	    font-weight: 700;
	    text-align: right;
	    color: green;
	    white-space: nowrap;
	}
	.time{
		font-size: 12px;
		color: rgba(0, 0, 0, .8);
		line-height: 17px;
		margin-top: 10px
	}
	.tit{
	    font-size: 14px;
	    color: rgba(0, 0, 0, .8);
	    line-height: 20px;
	    font-weight: 700;
	}
	.de_wrap{
		flex:2;
	}
	.item-list{
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 16px 8px;
		border-bottom: 1px solid #ececec;
	}
	.basic_btn{
		margin: 50px auto 0 auto;
		height: 45px;
		line-height: 45px;
		font-size: 16px;
		width: 90%;
		background: linear-gradient(90deg, #e4392e, #ff4d16);
		border-radius: 23px;
		color: #fff;
		text-align: center;
	}
	.colorRed{
		color:red;
	}
	.container-vip{
		background-color: #f6f6f6;
	}
	.lang-top{
		display: flex;
		padding-left:10rpx;
		height:88rpx;
		line-height:88rpx;
		background-color: #fff;
	}
	.backIcon{
		width:20%;
	}
	.langText{
		font-size:36rpx;
		width:60%;
		text-align: center;
		
	}
	.clearView{
		width:20%;
	}
	.content-view{
		background: #fff;
		padding: 20rpx 40rpx;
		margin: 0 auto;
		font-size:24rpx;
		
	}
	.content-view>p{
		height:80rpx;
		line-height:80rpx;
		font-size: 28rpx;
		line-height: 80rpx;
		color: rgba(0, 0, 0, .8);
		font-weight: 700;
	}
</style>